package com.ybfenpan.controller.admin.sys;


import com.ybfenpan.controller.core.BaseController;
import com.ybfenpan.service.QqService;
import com.ybfenpan.taglib.pagetag.Pagination;
import com.ybfenpan.utils.MapUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;


/**
 * Created by Administrator on 2016/3/25.
 */
@Controller

public class QqListController extends BaseController {
    @Resource
    private QqService qqService;
   
   
    @RequestMapping("admin/sys/qqList.shtml")
    public String list(HttpServletRequest request) throws Exception{
        HashMap formMap = getParameterMap(request);
       
        Pagination page = qqService.queryForPageList(formMap);
        request.setAttribute(Pagination.pageBeanName, page);
        return "admin/sys/qqList";
    }

    @RequestMapping("admin/sys/qqDelete.shtml")
    public String delete(HttpServletRequest request) throws Exception{
        Map formMap = getParameterMap(request);
        int id = MapUtil.getIntValue(formMap, "id");
        if(0 < id){
        	 
        	qqService.delete(id);
        }
        return "redirect:qqList.shtml";
       
    }
}
